/**
 * 
 */
package application;

import static implementations.Values.undirectedEdge;
import static implementations.Values.undirectedGraph;
import static implementations.Values.vertex;
import interfaces.Edge;
import interfaces.Graph;
import interfaces.Vertex;

import java.util.HashSet;
import java.util.Set;

/**
 * @author Kai Bielenberg (kai.bielenberg@haw-hamburg.de)
 *
 */
public class GkaAufgabe4 {

    /**
     * @param args
     */
    public static void main(String[] args) {
        System.out.println(":---------------------------------------------:");
        System.out.println(":Eulertouren - Flury:");
        System.out.println(":---------------------------------------------:");

        Vertex<String> v1 = vertex("v1");
        Vertex<String> v2 = vertex("v2");
        Vertex<String> v3 = vertex("v3");
        Vertex<String> v4 = vertex("v4");
        Vertex<String> v5 = vertex("v5");
        
        Edge<String,String> e1 = undirectedEdge("e1",v1,v2);
        Set<Edge<String,String>> allEdges = new HashSet<Edge<String,String>>();
        Graph<String,String> g1 = undirectedGraph(v1);
        Edge<String,String> e2 = undirectedEdge("e2",v2,v3);
        Edge<String,String> e3 = undirectedEdge("e3",v3,v4);
        Edge<String,String> e4 = undirectedEdge("e4",v4,v1);
        Edge<String,String> e5 = undirectedEdge("e5",v1,v5);
        Edge<String,String> e6 = undirectedEdge("e6",v5,v2);
        Edge<String,String> e7 = undirectedEdge("e7",v1,v3);
        Edge<String,String> e8 = undirectedEdge("e8",v2,v4);
        g1.add(e1);
        g1.add(e2);
        g1.add(e3);
        g1.add(e4);
        g1.add(e5);
        g1.add(e6);
        g1.add(e7);
        g1.add(e8);
        
        System.out.println("Beispiel 1 Graph(Haus vom Nikolaus):\n");
        System.out.println(g1);
        System.out.println("---------------------------\n");
      
        System.out.println("Eulertour: " + g1.eulerTour());
        System.out.println("Laufzeit: " + g1.runtimeLastAlgorithm());
        System.out.println("Zugriffe: " + g1.lastNumberOfAccesses());
        System.out.println("-------------------------------------------\n\n");
        
        System.out.println(":---------------------------------------------:");
        System.out.println(":HamiltonianPath - Depth-First-Search:");
        System.out.println(":---------------------------------------------:");
        
        System.out.println("Beispiel 1 Graph(Haus vom Nikolaus):\n");
        System.out.println(g1);
        System.out.println("---------------------------\n");
        
        System.out.println("---------------------------\n");
        System.out.println("Searching Tour");
        System.out.println("Hamiltonpfad: " + g1.hamiltonianPath());
        System.out.println("Laufzeit: " + g1.runtimeLastAlgorithm());
        System.out.println("Zugriffe: " + g1.lastNumberOfAccesses());
        System.out.println("-------------------------------------------\n\n");
    }

}
